package io.renren.sf.service.impl;

import io.renren.sf.vo.SelectedCopyingExamplesCharacterVo;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.sf.dao.HzSelectedCopyingExamplesDao;
import io.renren.sf.entity.HzSelectedCopyingExamplesEntity;
import io.renren.sf.service.HzSelectedCopyingExamplesService;


@Service("hzSelectedCopyingExamplesService")
public class HzSelectedCopyingExamplesServiceImpl extends ServiceImpl<HzSelectedCopyingExamplesDao, HzSelectedCopyingExamplesEntity> implements HzSelectedCopyingExamplesService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<HzSelectedCopyingExamplesEntity> page = this.page(
                new Query<HzSelectedCopyingExamplesEntity>().getPage(params),
                new QueryWrapper<HzSelectedCopyingExamplesEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SelectedCopyingExamplesCharacterVo> queryExamples(Integer curPage, Integer pageSize, String structureType, String condition) {
        curPage = (curPage-1) * pageSize;
        return this.baseMapper.queryExamples(curPage, pageSize, structureType, condition);
    }

    @Override
    public Integer queryExamplesNum(String structureType, String condition) {
        return this.baseMapper.queryExamplesNum(structureType, condition);
    }

}